cmake_minimum_required(VERSION 3.10)

# 项目名称
project(shard_server)

# 设置 C++ 标准为 C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 包含头文件目录
include_directories(
    include
    include/IPC
    include/IPC/ShmService
    include/IPC/ShmMemory/interface
    include/IPC/ShmMemory
    include/IPC/ShmMessage
    include/Utils
    include/Utils/ShmThread  
    include/Utils/SharedPtr 
    include/Utils/LockDataStructure
    include/DataStructure
    include/DataStructure/ShmQueue
)

# 添加源文件
set(SERVER_SOURCE_FILES shard_server.cc)
set(CLIENT_SOURCE_FILES client.cc)

# 生成可执行文件
add_executable(shard_server ${SERVER_SOURCE_FILES})
add_executable(client ${CLIENT_SOURCE_FILES})

# 链接线程库
find_package(Threads REQUIRED)
target_link_libraries(shard_server ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(client ${CMAKE_THREAD_LIBS_INIT})
